<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>

<body>
    <div id="need">
        <!-- <input type="button" value="点我" v-on:click="dolt"> -->
        <!-- <input type="button" value="点我" @click="doit"> -->
        <input type="button" value="点我" @dblclick="doit">

        <div id="center"></div>
        <h2 @click="change">{{detail}}</h2>
    </div>
</body>
<script>
    var vue = new Vue({
        el: "#need",
        data: {git --version
            message: "点我",
            detail: "我是一个鬼"
        },

        methods: {   //语法
            doit: function () {  //语法
                // 逻辑
                alert("我是个程序员");
            },
            change: function () {
                // console.log(this.detail);
                this.detail += "魔鬼吧！"
            }

        }
    })

</script>

</html>